<?php

namespace User\Mapper;

use Base\Mapper\AbstractDbMapper;
use User\Mapper\UserInterface;
use Zend\Stdlib\Hydrator\HydratorInterface as Hydrator;

class User extends AbstractDbMapper implements UserInterface
{
    protected $tableName = 'user';

    public function findByEmail($email){}

    public function findByUsername($username){}

    public function findById($id){}

    public function getTableName()
    {
        return $this->tableName;
    }

    public function setTableName($tableName)
    {
        $this->tableName=$tableName;
    }


    public function insert($entity , $tableName = null , Hydrator $hydrator = null)
    {
        $hydrator = $hydrator ?: $this->getHydrator();
        $result = parent::insert($entity , $tableName , $hydrator);
        //$hydrator->hydrate(array('user_id' => $result->getGeneratedValue()), $entity);
        return $result;
    }

    public function update($user)
    {

    }
} 